package com.sc.utils;

import org.apache.ibatis.datasource.pooled.PooledDataSource;
import org.springframework.context.annotation.Bean;

import javax.sql.DataSource;

/**
 * @description: java connect config
 * @author: sc
 * @create: 2023-02-25 11:58
 **/
public class DataSourceConfig {
    private String url="jdbc:hsqldb:hsql://localhost/";
    private String user="SA";
    private String password="";
    private String driverClass="org.hsqldb.jdbcDriver";

    @Bean(name = "dataSource")
    public DataSource dataSource() {
        PooledDataSource dataSource = new PooledDataSource();
        dataSource.setDriver(driverClass);
        dataSource.setUrl(url);
        dataSource.setUsername(user);
        dataSource.setPassword(password);
        return dataSource;
    }

}